import os

# JWT配置
ACCESS_TOKEN_EXPIRE_MINUTES = 30  # 访问令牌过期时间（分钟）
SECRET_KEY = "your-secret-key"  # 用于签名JWT的密钥，请在生产环境中使用安全的随机值
ALGORITHM = "HS256"  # JWT签名算法

# 数据库配置
class TestConfig:
    # DATABASE_URL = "sqlite:///./schemas/subscription_system.db"
    # DATABASE_URL = "postgresql://user:password@123.207.53.152:5432/test_db_name"
    DATABASE_URL = "postgresql://user:password@123.207.53.152:5432/dbname"
    DEBUG = True

class ProductionConfig:
    DATABASE_URL = os.getenv("DATABASE_URL", "postgresql://user:password@db:5432/dbname")
    DEBUG = os.getenv("DEBUG", "False").lower() == "true"

# 根据环境参数设置当前配置
ENV = os.getenv("ENV", "dev").lower()

if ENV == "dev":
    CURRENT_CONFIG = TestConfig
elif ENV == "prd":
    CURRENT_CONFIG = ProductionConfig
else:
    raise ValueError("无效的环境参数。请设置 ENV 为 'dev' 或 'prd'。")
